<div class="content-titulo">
    <h2><?php echo $this->titulo;?></h2>
    <div class="content-btn">
        <a href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit','id'=>'','gcd_id' => $this->gcd_id)); ?>">+</a>
    </div>
</div>


<div class="content-list">
    
<?php foreach ($this->result as $row) {  ?>
    <div class="item" style="height:100px">    
        <div class="col" style="width: 200px">
            <p><strong>Código: <?php echo $row['CRD_ID']; ?></strong></p>
            <p><strong>Título: </strong><?php echo $row['CRD_NOM']; ?></p>
            <p><strong>Status: </strong><?php echo tools::returnStatus($row['CRD_STA']); ?></p>
        </div>
        <div class="col" style="width: 200px">
            <p><strong>Referência: </strong><?php echo $row['CRD_REF']; ?></p>
            <p><strong>Cor: </strong><?php 
                $img = glob('public/upload/cordetalhe/'.$row['CRD_ID'].'.*');
                if(!isset($img[0])) echo $row['CRD_COR']; 
                ?></p>
            <ul class="grade_cor">
                <?php if(!isset($img[0])) { ?>
                <li style="background-color: #<?php echo $row['CRD_COR']; ?>"></li>
                <?php } else{ 
                        echo '<img src="'.$this->urlbase.'/'.$img[0].'" style="border: 1px solid #333;" />';
                 } ?>
            </ul>
        </div>
        
        <div class="col" style="width: 150px">
            
        </div>
        
       
        
        <div class="btn-actions" style="padding-top: 10px;">
            <?php if($this->per_edt){?><a class="btn-pdr" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit', 'id' => $row['CRD_ID'], 'gcd_id' => $this->gcd_id)); ?>">Editar</a><?php }?>
            <?php if($row['CRD_STA'] == 0){?><a class="btn-pdr" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'delete', 'id' => $row['CRD_ID'], 'gcd_id' => $this->gcd_id)); ?>" >Deletar</a><?php }?>            
        </div>

      </div>
    <?php } ?>
</div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>

<a href="<?php echo $this->voltar; ?>">Voltar para Grade</a>

